package com.jxgc.excel.demo;

import org.apache.commons.math3.stat.descriptive.summary.Product;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class demo {
    public static void main(String[] args) throws IOException {



    }
    public static List<Product> read (String path){
        //1.获取工作簿
        XSSFWorkbook workbook = new XSSFWorkbook("D:\\text\\excel(1).xlsx");
        //2.获取工作表
        XSSFSheet sheet = workbook.getSheetAt(0);
        int lastRowNum = sheet.getLastRowNum();
        for (int i = 1; i <=lastRowNum; i++) {
            XSSFRow row = sheet.getRow(i);
            if(row!=null){
                List<String> list = new ArrayList<>();
                for (Cell cell : row) {
                    if(cell!=null){

                        String value = cell.getStringCellValue();
                    }

                }
            }

        }

    }

}
